package com.woniu.mapper;

import com.woniu.domain.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zyy
 * @since 2021-03-05
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT r.*\n" +
            "from t_user u\n" +
            "join t_user_role ur\n" +
            "on u.id=ur.uid\n" +
            "join t_role r\n" +
            "on r.role_id=ur.rid\n" +
            "WHERE u.username=#{username}")
    public List<Role> getRole(String username);



}
